gui: fix dark mode change on Windows 10 with universal style
authorJyrki Gadinger <nilsding@nilsding.org>
Mon, 17 Mar 2025 14:35:49 +0000 (15:35 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 18 Mar 2025 07:54:44 +0000 (07:54 +0000)
commit6898f86aeb1f50656dea8150638c790f59d33805
treec5939b0696e13cf86113d13e94e12fb27b38dc28
parentb234cd2e2fc25679f33a820fccb21add6c3610a7
gui: fix dark mode change on Windows 10 with universal style

The _Universal_ QML style has a theme that uses the colour scheme from
the system.  This can be set by either configuring
`qtquickcontrols2.conf` or setting the environment variable
`QT_QUICK_CONTROLS_UNIVERSAL_THEME=System`.

Unfortunately, due to [QTBUG-128825], setting the theme in the
configuration file/environment variable results in the dark/light mode
setting only be set during startup, not during runtime.  Not ideal, but
still better than not having a broken dark mode theme at all.

Fixes #7991

[QTBUG-128825]: https://bugreports.qt.io/browse/QTBUG-128825

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
src/gui/main.cpp